﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;
using System.Web;
using System.Web.Mvc;
using System.Net;
using JustMVCTest.Models;

namespace JustMVCTest.Controllers
{
    public class HelloWorldController : Controller
    {
        // 
        // GET: /HelloWorld/ 

        public ActionResult Index()
        {
            return View();
        }

        // 
        // GET: /HelloWorld/Welcome/ 

        public ActionResult Welcome(string name, int numTimes = 1)
        {
            ViewBag.Message = "Hello " + name;
            ViewBag.NumTimes = numTimes;

            //TODO: Touch PO_Import
            //PODBContext db3 = new PODBContext();

            //db3.PO_Imports.Count();
            
            return View();
        }


        public void Mail(string[] args)
        {
            var client = new SmtpClient("smtp.gmail.com", 587)
            {
                Credentials = new NetworkCredential("papiproj@gmail.com", "0545357710"),
                EnableSsl = true
            };
            client.Send("papiproj@gmail.com", "papiproj@gmail.com", "test", "testbody");
            Console.WriteLine("Sent");
            Console.ReadLine();
            
        }
    }
}